import request from '@/api/request.js';

// 发送验证码
export const SendSmsCode = (data) => {
	return request(`/auth/smsCode`, 'POST', data, false)
}

// 校验验证码是否正确
export const CheckSmsCode = (data) => {
	return request(`/auth/check/smsCode`, 'POST', data, true)
}

// 注册
export const Register = (data) => {
	return request(`/auth/register/person`, 'POST', data, true)
}

// 一键登录 
export const OneKeyLogin = (data) => {
	return request(`/auth/phoneOneKeyLogin`, 'POST', data, true)
}

// 用户登录 
export const Login = (data) => {
	return request(`/auth/login/person`, 'POST', data, true)
}

// 找回密码-校验忘记密码短信验证码
export const CheckForgetCode = (data) => {
	return request(`/auth/reset/check`, 'POST', data, true)
}

// 找回密码
export const ResetPwd = (data) => {
	return request(`/auth/reset/pwd`, 'POST', data, false)
}

//	微信授权获取手机号
export const GetWechatPhone = (data) => {
	return request(`/auth/wx/phone`, 'GET', data, false)
}

//	微信授权登录
export const AppWechatLogin = (data) => {
	return request(`/auth/wx/login`, 'POST', data, true)
}
//	微信小程序登录
export const WechatLogin = (data) => {
	return request(`/auth/applet/login`, 'POST', data, true)
}

// 退出
export const Logout = (data) => {
	return request(`/auth/loginOut`, 'POST', data, true)
}

//	账户注销 
export const AccountCancellation = (data) => {
	return request(`/system/userInfo/closeAccount`, 'GET', data, true)
}

//	版本更新查询
export const GetVersionUpdatingApi = (data) => {
	return request(`/system/ruleAppUpgrade/byType`, 'GET', data, false)
}

//	恢复已注销状态、改名卡
export const UpdateCancelState = (data) => {
	return request(`/system/userInfo/save`, 'POST', data, true)
}
//用户协议
export const GetUserRuleList = (data) => {
	return request(`/system/rulePrivacyAgreement/getByCode`, 'GET', data, true)
}

//	文件上传获取 OSS 配置
export const GetStsTemp = (data) => {
	return request(`/auth/upload/getStsTemp`, 'GET', data, true)
}

//	清除绑定机型ID
export const RemovePushId = (data) => {
	return request(`/system/userPushUnit/update`, 'GET', data, true)
}


//	个性化推送
export const SetCustomOnOffApi = (data) => {
	return request(`/system/userInfo/onOff`, 'GET', data, true)
}

// 微信小程序 充值 获取openid
export const GetAppletOpenId = (data) => {
	return request(`/auth/applet/openid`, 'GET', data, true)
}
//解绑实名认证
export const RemoveRealName = (data) => {
	return request(`/system/userInfo/delAuthInfo`, 'POST', data, true)
}


// 查询弹窗配置
export const GetLoginCurtainList = (data) => {
	return request(`/system/popConfig/getLoginList`, 'GET', data, false)
}

export const GetNotLoginCurtainList = (data) => {
	return request(`/system/popConfig/getNotLoginList`, 'GET', data, false)
}